# coding=utf-8

class XMindCheck(object):
    """校验规则
    """

    def __init__(self, path):
        self.path = path
        self.file_suffix = self.judge_file_suffix()

    def judge_file_suffix(self):
        """判断文件类型
        :return:
        """
        # 取最后一个 如：需求v2.1.0.XMind
        file_suffix = self.path.split('.')[-1]
        if file_suffix not in ['xmind']:
            raise Exception('请选择xmind文件导入')
        return file_suffix

    # todo
    def check_library(self):
        """校验产品名称是否存在
        :return:
        :return: 用例库id
        """
        return
